<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>
		<p:dataTable var="purchaseRequisition" value="#{lazyModel}"
			styleClass="prOpenTable" 
			selectionMode="single"	paginator="false" rows="20"
			selection="#{backingBean.selectedItem}" lazy="true">
			
			<p:ajax event="rowSelect"
				listener="#{dtPurchaseRequisitionView.onRowSelect}"
				update="#{ajaxRowSelectUpdate}" oncomplete="PF('itemDialog').show()" />
				
			<p:column headerText="ID" style="width:70px;" styleClass="prOpenTableId"
				sortBy="#{purchaseRequisition.id}" filterBy="#{purchaseRequisition.id}">
				<h:outputText value="#{purchaseRequisition.id}" />
			</p:column>
						
			<p:column headerText="Purpose" styleClass="prOpenTableFilter" 
				sortBy="#{purchaseRequisition.description}" filterBy="#{purchaseRequisition.description}">
				<h:outputText value="#{purchaseRequisition.description}" />
			</p:column>
			
			<p:column headerText="Owner"  style="width:110px;" 
				sortBy="#{purchaseRequisition.ownerName}" filterBy="#{purchaseRequisition.ownerName}">
				<h:outputText value="#{purchaseRequisition.ownerName}" />
			</p:column>
			
			<p:column headerText="Request Date"  style="width:110px;"
				sortBy="#{purchaseRequisition.requisitionDate}" filterBy="#{purchaseRequisition.requisitionDate}">
				<h:outputText value="#{purchaseRequisition.requisitionDate}">
					<f:convertDateTime pattern="MM/dd/yyyy" />
				</h:outputText>
			</p:column>
						
			<p:column headerText="Remarks" styleClass="prOpenTableFilter"
				filterBy="#{purchaseRequisition.remarks}">
				<h:outputText value="#{purchaseRequisition.remarks}" />
			</p:column>
						
		</p:dataTable>

	</ui:composition>
</body>
</html>